using UnityEngine;

public class ArcadeSelectLayer : MonoBehaviour
{
	public Transform firstObject;

	public UIScrollView view;

	public UITable table;

	private int tableRepositionCount;

	protected bool isAligned;

	private PlayerInventory.Item difficulty;

	private void OnEnable()
	{
		Ads.instance.hideBanner(false);
		tableRepositionCount = 0;
		isAligned = false;
	}

	public void OnEasy()
	{
		difficulty = PlayerInventory.Item.EasyModeItem;
		RunGame();
	}

	public void OnMedium()
	{
		difficulty = PlayerInventory.Item.MediumModeItem;
		RunGame();
	}

	public void OnHard()
	{
		difficulty = PlayerInventory.Item.HardModeItem;
		RunGame();
	}

	private void RunGame()
	{
	}

	private void Update()
	{
		if (tableRepositionCount <= 10)
		{
			if (tableRepositionCount == 10)
			{
				table.Reposition();
			}
			if (tableRepositionCount++ == 10 && !isAligned)
			{
				UITools.AlignToTopOnScroll(firstObject.GetComponent<UIWidget>(), view, -10f);
				isAligned = true;
			}
		}
	}
}
